home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Tools / Languages / Harvest C 1.3 / Source Code / CWarningsArray.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-06-15  |  2.2 KB  |  80 lines  |  [TEXT/KAHL]

  1. /*
  2.     Harvest C
  3.     Copyright 1992 Eric W. Sink.  All rights reserved.
  4.     
  5.     This file is part of Harvest C.
  6.     
  7.     Harvest C is free software; you can redistribute it and/or modify
  8.     it under the terms of the GNU Generic Public License as published by
  9.     the Free Software Foundation; either version 2, or (at your option)
  10.     any later version.
  11.     
  12.     Harvest C is distributed in the hope that it will be useful,
  13.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15.     GNU General Public License for more details.
  16.     
  17.     You should have received a copy of the GNU General Public License
  18.     along with Harvest C; see the file COPYING.  If not, write to
  19.     the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  20.     
  21.     Harvest C is not in any way a product of the Free Software Foundation.
  22.     Harvest C is not GNU software.
  23.     Harvest C is not public domain.
  24.  
  25.     This file may have other copyrights which are applicable as well.
  26.  
  27. */
  28.  
  29. /******************************************************************************
  30.  CWarningsArray.c
  31.  
  32.         
  33.     SUPERCLASS = CArray
  34.     
  35.     Copyright © 1991 Symantec Corporation. All rights reserved.
  36.     
  37.  
  38.  ******************************************************************************/
  39.  
  40. #include "CWarningsArray.h"
  41. #include "stdlib.h"
  42. #include "Packages.h"
  43.  
  44.     
  45. /******************************************************************************
  46.  IWarningsArray
  47. ******************************************************************************/
  48.  
  49. void CWarningsArray::IWarningsArray( CHarvestOptions *itsOpts)
  50. {
  51.     CArray::IArray(sizeof(struct Warning));
  52.     theOpts = itsOpts;
  53.     WarningCount = 0;
  54.     
  55. }    /* CWarningsArray::IWarningsArray */
  56.  
  57. void CWarningsArray::GetWarningEntry(char *t,int n) {
  58.     struct Warning theWarning;
  59.     GetItem(&theWarning,n);
  60.     CopyPString(theWarning.desc,t);
  61.     if (theOpts->warnings[theWarning.num]) {
  62.         CopyPString("\p ON   ",t);
  63.     }
  64.     else {
  65.         CopyPString("\p OFF ",t);
  66.     }
  67.     ConcatPStrings(t,theWarning.desc);
  68. }
  69.  
  70. void CWarningsArray::AddWarning(unsigned char *s,int n,Boolean defValue)
  71. {
  72.     struct Warning w;
  73.     CopyPString(s,w.desc);
  74.     w.num = n;
  75.     w.isOn = defValue;
  76.     WarningCount++;
  77.     InsertAtIndex((Ptr) &w,WarningCount);
  78.     theOpts->warnings[n] = defValue;
  79. }
  80.